package com.ems.service.impl.supers.questions;

import com.ems.dao.supers.questions.SubjectDao;
import com.ems.pojo.questions.Grade;
import com.ems.pojo.questions.Subject;
import com.ems.pojo.questions.Tlevel;
import com.ems.service.supers.questions.SubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: 伟伟
 * @Date: 2019/10/16
 * @Description: 描述
 * @Version: 1.0
 */
@Service("subjectService")
public class SubjectServiceImpl implements SubjectService {

    @Autowired
    private SubjectDao subjectDao;

    /**
     * 获取所有试题种类
     * @return
     */
    @Override
    public List<Tlevel> getAllSubject() {
        return subjectDao.getAllSubject();
    }


    @Override
    public void addLevel(Tlevel tlevel) {
        subjectDao.addLevel(tlevel);
    }

    @Override
    public void deleteLevel(Tlevel tlevel) {
       subjectDao.deleteLevel(tlevel);
    }

    @Override
    public void addGrade(Grade grade) {
       subjectDao.addGrade(grade);
    }

    @Override
    public void deleteGrade(Grade grade) {
       subjectDao.deleteGrade(grade);
    }

    @Override
    public void addSubject(Subject subject) {
       subjectDao.addSubject(subject);
    }

    @Override
    public void deleteSubject(Subject subject) {
       subjectDao.deleteSubject(subject);
    }

    @Override
    public List<Grade> findAllGrade(Tlevel tlevel) {
        return subjectDao.findAllGrade(tlevel);
    }

    @Override
    public List<Subject> findAllSubject(Grade grade) {
        return subjectDao.findAllSubject(grade);
    }

    @Override
    public List<Tlevel> findAllLevel() {
        return subjectDao.findAllLevel();
    }

    @Override
    public void editLevel(Tlevel tlevel) {
        subjectDao.editLevel(tlevel);
    }

    @Override
    public void editGrade(Grade grade) {
        subjectDao.editGrade(grade);
    }

    @Override
    public void editSubject(Subject subject) {
       subjectDao.editSubject(subject);
    }

    @Override
    public Subject getSubNameBySbId(int sb_id) {
        return subjectDao.getSubNameBySbId(sb_id);
    }
}
